<?php

namespace Database\Seeders;

use App\Models\Comment;
use App\Models\Lesson;
use App\Models\Sign;
use App\Models\System;
use App\Models\Topic;
use App\Models\User;
use App\Models\Video;
use Database\Factories\TopicFactory;
use Illuminate\Database\Seeder;

class DatabaseSeeder extends Seeder
{
    /**
     * Seed the application's database.
     *
     * @return void
     */
    public function run()
    {
        User::factory(10)->create();
        $user = User::first();
        $user->name = '徐一杰';
        $user->mobile = env('MOBILE');
        $user->email = env('EMAIL');
        $user->save();

        Topic::factory(50)->create();
        System::factory(10)->create();
        Lesson::factory(30)->create();
        Video::factory(100)->create();
        Sign::factory(100)->create();
        Comment::factory(2)->create();

        Comment::find(2)->update([
            'comment_id' => 1,
            'reply_user_id' => Comment::find(1)->user_id
        ]);

    }
}
